<script type="text/javascript">
	$(document).ready(function(){
		$.validator.messages.required = "";
		$.validator.messages.date = "";
		$("#VanBanDen").validate();
	});
</script>
<?php
if(isset($_SESSION['QuyenHan']) && $_SESSION['QuyenHan'] == 4)
{

	// Lấy mã sách từ thanh địa chỉ
	$id = $_GET['id'];
	
	$vanbanden = new vanbandenbs();
	$vanbanden->MaVanBanDen = $id;
	$danhsach = $vanbanden->GetList();
?>

<div id="NoiDung" class="form">
  <h3 class="text-primary">Văn Bản Đến  <?php echo $danhsach[0]['SovaKyHieu']; ?></h3>
  <form  action="vanbanden-sua-xuly" method="post" role="form">
  <input type="hidden" value="<?php echo $danhsach[0]['MaVanBanDen']?>" name="MaVanBanDen"/>
     <table class="table borderless">
        <tbody>
          <tr>
           <td>
                <div class="form-group form-custom">
                  <label  for="sovakyhieu">Số và ký hiệu:</label>
                    <input type="text" class="form-control" placeholder="Số và ký hiệu" name="SovaKyHieu"  value="<?php echo $danhsach[0]['SovaKyHieu']?>" class="required" />
                </div>
        	</td>
            
            <td>
            	  <div class="form-group form-custom">
                  <label  for="noibanhanh">Nơi ban hành:</label>
                    <input type="text" class="form-control" placeholder="Nơi ban hành" name="NoiBanHanh" value="<?php echo $danhsach[0]['NoiBanHanh']?>"   class="required" />
                  
                </div>
           </td>
         </tr>
         <tr>
          	<td>
              <div class=" form-group form-custom control-group">
                <label class="control-label">Ngày ban hành</label>
                <div class="controls input-append date form_date" data-date="" data-date-format="dd MM yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                    <input size="16" type="text" value="<?php echo $danhsach[0]['NgayBanHanh']?>"  readonly="readonly" name="NgayBanHanh" class="form-control">
                    <span class="add-on"><i class="icon-remove"></i></span>
					<span class="add-on"><i class="icon-th"></i></span>
                </div>
				
            </div>
            
        	</td>
           
            <td>
                 <div class=" form-group form-custom control-group">
                <label class="control-label">Ngày hết hạn</label>
                <div class="controls input-append date form_date" data-date="" data-date-format="dd MM yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                    <input size="16" type="text" value="<?php echo $danhsach[0]['NgayHetHan']?>"  readonly="readonly" name="NgayHetHan" class="form-control">
                    <span class="add-on"><i class="icon-remove"></i></span>
					<span class="add-on"><i class="icon-th"></i></span>
                </div>
				
            </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="form-group form-custom">
                  <label  for="maloaivanban">Loại Văn Bản:</label>
                   <select name="MaLoaiVanBan" class="form-control">
                   <?php
                    $loaiVB = new loaivanbanbs();
                    $dsLVB = $loaiVB->GetList();
                    for($i=0;$i< count($dsLVB) ;$i++)
                    {
                        echo "<option value=".$dsLVB[$i]['MaLoaiVanBan'].">".$dsLVB[$i]['TenLoaiVanBan']."</option>";
                    }
                   ?>
                  </select>
                  
                </div>
            </td>
            <td>
                <div class="form-group form-custom">
                  <label  for="trichyeu">Trích Yếu:</label>
                    <input type="text" class="form-control" placeholder="Trích yếu" value="<?php echo $danhsach[0]['TrichYeu']?>"  name="TrichYeu" class="required" />
           
                </div>
            </td>
           
        </tr>
       
          <tr>
        <td colspan="2">
        <input type="submit" value="Sữa" class="btn btn-primary btn-primary pull-right" name="btnSua" />
         </td>
        </tr>
       </tbody>
        
      </table>
    </form>	    
</div>
<script type="text/javascript">
   
	$('.form_date').datetimepicker({
      	format: 'dd-mm-yyyy',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0
    });
	
</script>
<?php
}else
{
	ThongBaoLoi("Vui lòng đăng nhập !");
}
?>